Skip to content

Conversation

@franciscovalentecastro
Copy link
Contributor

@franciscovalentecastro franciscovalentecastro commented Dec 19, 2025

Description

Configuring the file_storage extension to be used as storage in Otel Logging receivers.

Some details :

  • Added to systemd, files and windows_event_log logging receiver.
  • The following folders will be used to store the bookmarks :
    • Linux : /var/lib/google-cloud-ops-agent/opentelemetry-collector\file_storage/
    • Windows : C:\ProgramData\Google\Cloud Operations\Ops Agent\run\file_storage

Related issue

b/469432672

How has this been tested?

Checklist:

  • Unit tests
    • Unit tests do not apply.
    • Unit tests have been added/modified and passed for this PR.
  • Integration tests
    • Integration tests do not apply.
    • Integration tests have been added/modified and passed for this PR.
  • Documentation
    • This PR introduces no user visible changes.
    • This PR introduces user visible changes and the corresponding documentation change has been made.
  • Minor version bump
    • This PR introduces no new features.
    • This PR introduces new features, and there is a separate PR to bump the minor version since the last release already.
    • This PR bumps the version.

@jefferbrecht
Copy link
Member

jefferbrecht commented Jan 12, 2026

Any thoughts on file_storage vs. db_storage? Do you have any concerns about unbounded retention of offsets for scenarios where someone configures a wildcard path?

@franciscovalentecastro franciscovalentecastro changed the title [confgenerator] Add bookmarking to Otel Logging receivers. [confgenerator] Add file offset storage to Otel Logging receivers. Jan 14, 2026
@franciscovalentecastro franciscovalentecastro added the kokoro:force-run Forces kokoro to run integration tests on a CL label Jan 30, 2026
@stackdriver-instrumentation-release stackdriver-instrumentation-release removed the kokoro:force-run Forces kokoro to run integration tests on a CL label Jan 30, 2026
@franciscovalentecastro franciscovalentecastro added the kokoro:force-run Forces kokoro to run integration tests on a CL label Jan 30, 2026
@stackdriver-instrumentation-release stackdriver-instrumentation-release removed the kokoro:force-run Forces kokoro to run integration tests on a CL label Jan 30, 2026
@franciscovalentecastro franciscovalentecastro added the kokoro:force-run Forces kokoro to run integration tests on a CL label Jan 31, 2026
@stackdriver-instrumentation-release stackdriver-instrumentation-release removed the kokoro:force-run Forces kokoro to run integration tests on a CL label Jan 31, 2026
Comment on lines 6007 to 6012
if len(matchingLogs) == 0 {
t.Errorf(`Expected to find at least one instance of "first line" log in the backend. Found %d instances.`, len(matchingLogs))
}
if len(matchingLogs) >= 2 {
t.Errorf(`Expected to find only one instance of "first line" log in the backend. Found %d instances.`, len(matchingLogs))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: these can be combined into a single if len(matchingLogs) != 1 check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for completeness, this is the result of running locally the last iteration of this test (with the != 1 check) locally (without the file_storage update) :

=== NAME  TestFileOffset/debian-cloud:debian-11/otel_logging
    agents.go:1029: Instance Log: [redacted]
    main_test.go:6008: Expected to find exactly one instance of "first line" log in the backend. Found 2 instances.
--- FAIL: TestFileOffset (0.00s)
    --- FAIL: TestFileOffset/debian-cloud:debian-11 (0.00s)
        --- PASS: TestFileOffset/debian-cloud:debian-11/default (305.37s)
        --- FAIL: TestFileOffset/debian-cloud:debian-11/otel_logging (306.46s)
FAIL

go.sum Outdated
github.com/GoogleCloudPlatform/google-guest-agent v0.0.0-20250924181420-23412fbd6228/go.mod h1:31SvkAl6ORtir1odRpTl92XpTtn52GnBAHPtCKDSePo=
github.com/GoogleCloudPlatform/opentelemetry-operations-collector/integration_test/gce-testing-internal v0.0.0-20260119145159-eff68fc7b8ef h1:v2hZ/3wkAB/9TvEqqE3zjlVsqozs4rzZ4zqvW/9YPLQ=
github.com/GoogleCloudPlatform/opentelemetry-operations-collector/integration_test/gce-testing-internal v0.0.0-20260119145159-eff68fc7b8ef/go.mod h1:hmqK+hsg2z+Xo/Yz16sNxb6TZX+q0KxKsrgYzdpV0P8=
github.com/GoogleCloudPlatform/opentelemetry-operations-collector/integration_test/gce-testing-internal v0.0.0-20260130171200-8bbc62976af0 h1:QeKYB2SRm5fOk6l91p8kNd6XkDBk/nwaeWnTwwBqwYQ=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: run go mod tidy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@jefferbrecht
Copy link
Member

LGTM modulo some remaining nits

@franciscovalentecastro franciscovalentecastro merged commit f462b7e into master Feb 2, 2026
74 of 97 checks passed
@franciscovalentecastro franciscovalentecastro deleted the fcovalente-bookmarking branch February 2, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants